package com.zhike.common.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *
 * @TableName zhike_post
 */
@TableName(value ="zhike_post")
@Data
public class ZhikePost implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 动态类型 1 图文 2 视频
     */
    private Integer type;

    /**
     * 标题
     */
    private String title;

    /**
     * 文字内容
     */
    private String content;

    /**
     * 文件地址
     */
    private String fileUrls;

    /**
     * 分类
     */
    private Integer categoryId;

    /**
     * 所属用户
     */
    private String userId;

    /**
     * 话题
     */
    private String topicId;

    /**
     * 经纬度
     */
    private String location;

    /**
     * 浏览量
     * */
    private Integer browses;

    /**
     * 地址
     */
    private String locationStr;

    /**
     * 展示权限 1、公开 2、不给谁看 3、只给谁看 4、仅自己可见
     */
    private Integer showType;

    /**
     * 展示用户ids
     */
    private String showUserIds;

    /**
     * 排除用户ids
     */
    private String excludeUserIds;

    @ApiModelProperty("点赞数量")
    private Integer likeTotal;

    @ApiModelProperty("评论数量")
    private Integer commentTotal;

    @ApiModelProperty("收藏数量")
    private Integer collectTotal;

    @Version
    private Integer version;
    /**
     *
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("分类文本")
    @TableField(exist = false)
    private String categoryStr;

    @ApiModelProperty("是否点赞")
    @TableField(exist = false)
    private int isLike ;

    @ApiModelProperty("是否收藏")
    @TableField(exist = false)
    private int isCollect ;

    @ApiModelProperty("是否关注作者")
    @TableField(exist = false)
    private int isFollowerAuthor ;

    @ApiModelProperty("用户头像")
    @TableField(exist = false)
    private String userAvatar;

    @ApiModelProperty("用户昵称")
    @TableField(exist = false)
    private String userNickName;

    @ApiModelProperty("话题集合")
    @TableField(exist = false)
    private List<ZhikePostTopic> topicList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
